home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / C++ A'Link Files / Feb 91 / CPlus.Dev$ 2⁄1⁄91 / 0273-Re Code Resources & -Feb91 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.5 KB  |  38 lines  |  [TEXT/GEOL]

  1. Item    9533643                         1-Feb-91        07:39PST
  2.  
  3. From:   MUYSVASOVIC                     ACE - Jean-Denis Muys-Vasovic
  4.  
  5. To:     HOWTEK.TECH                     Howtek, Cory Kempf,PRT
  6.         CPLUS.DEV$                      C++ Interest List--Developers
  7.         CPLUS.APPLE$                    C++ Interest List--Apple Employees
  8.  
  9. ------------------------------------------------------------------------------
  10.  
  11. Sub:    Re: Code Resources & Pure Virt
  12.  
  13. Dear Grr,
  14.  
  15. Do you really think that the compiler should output the full TN and the full
  16. appendix from the MPW documentation?
  17.  
  18. I personally believe that the linker message is terse, but informative. In a
  19. few words, there is a reference from data to code because you try to take the
  20. address of one of your procedure (in C: int (funptr*)() = &myProc;). In the
  21. Macintosh run time environment, the address of a procedure can change over
  22. time, and so the real address cannot be stored in your variable. For that to
  23. work, you need a relay, the address of which never changes: a jump table, and
  24. thus an A5 world, which you can't have in a code resource (well, you can, but
  25. you must fool the linker, and be very cautious).
  26.  
  27. In the case of of C++, a vtable is a data structure containing the adresses of
  28. some functions, thus the data to code reference.
  29.  
  30. All this is fully documented in the MPW appendix about the object code file
  31. format, and also in the TN about globals in standalone code, and also in a
  32. recent issue of Develop.
  33.  
  34. Regards
  35.  
  36. Jean-Denis
  37.  
  38.